<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
session_start();
require 'database/photo_handler.php';
?>
<div id="Recent_Photos" class="group_content">
        	<div id="_title">Recently Uploaded Photos</div><br/>
            <div id="list_photos" style="text-align:center">
			<?php
			$ph = new photo_handler();
			$ph->view_recent_photos(6);
			if ($ph->result[0][0]!=null) {
				for($i=0;$i<count($ph->result[0]);$i++)
				{?>
					<a href="gallery.php?view=2&photo_id=<?php echo $ph->result[2][$i]; ?>" alt=""><img src="<?php echo $ph->result[1][$i]; ?>" alt="" id="Foto1" height="100" width="100"/></a>
				<?php
				}
			}
			?>
            </div>
        </div>

	<div id="Popular_Photos" class="group_content">
        	<div id="_title">Popular Uploaded Photos</div><br/>
            <div id="list_photos" style="text-align:center">
			<?php
			$ph = new photo_handler();
			$ph->view_popular_photos();
			if ($ph->result[0][0]!=null) {
				for($i=0;$i<count($ph->result[0]);$i++)
				{?>
					<a href="gallery.php?view=2&photo_id=<?php echo $ph->result[2][$i]; ?>" alt=""><img src="<?php echo $ph->result[1][$i]; ?>" alt="" id="Foto1" height="100" width="100"/></a>
				<?php
				}
			}
			?>
            </div>
        </div>

		<div id="Favorite_Photos" class="group_content">
        	<div id="_title">Favorite Uploaded Photos</div><br/>
            <div id="list_photos" style="text-align:center">
			<?php
			$ph = new photo_handler();
			$ph->view_favorite_photos(6);
			if ($ph->result[0][0]!=null) {
				for($i=0;$i<count($ph->result[0]);$i++)
				{?>
					<a href="gallery.php?view=2&photo_id=<?php echo $ph->result[2][$i]; ?>" alt=""><img src="<?php echo $ph->result[1][$i]; ?>" alt="" id="Foto1" height="100" width="100"/></a>
				<?php
				}
			}
			?>
            </div>
        </div>
